Skip to content

fix(recipes): let apk wait for the lock instead of failing - #33

Merged
NovusEdge merged 1 commit into
mainfrom
recipes-apk-wait
Aug 10, 2026
Merged

fix(recipes): let apk wait for the lock instead of failing#33
NovusEdge merged 1 commit into
mainfrom
recipes-apk-wait

Conversation

@NovusEdge

@NovusEdge NovusEdge commented Aug 10, 2026

Copy link
Copy Markdown
Owner

A provision run died with ERROR: Unable to lock database: Resource temporarily unavailable and exit 99 when another apk held the apk lock.

Every apk add in the bundled Alpine recipes (devtools, docker, tailscale, xfce) now passes --wait 60, so apk waits up to 60s for the lock instead of failing immediately. setup-apkrepos and setup-xorg-base are alpine-conf helpers with no --wait flag, so they stay as they are; the per-VM provision lock (separate PR) removes the stoat-side source of contention.

just check and just test pass.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when installing bundled development tools, Docker, Tailscale, and XFCE packages on Alpine Linux.
    • Package installation now waits up to 60 seconds when another package operation is in progress, reducing failures caused by temporary package-manager locks.

Another apk process holds the database lock briefly during boot
provisioning. Without --wait, apk fails immediately with exit 99
and aborts the recipe.
@NovusEdge NovusEdge added the bug Something isn't working label Aug 10, 2026
@NovusEdge NovusEdge self-assigned this Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 64f25956-8272-429a-a37e-16fc5de0ba10

📥 Commits

Reviewing files that changed from the base of the PR and between 51ba1c6 and e65731e.

📒 Files selected for processing (4)
  • internal/recipes/bundled/devtools/install.sh
  • internal/recipes/bundled/docker/install.sh
  • internal/recipes/bundled/tailscale/install.sh
  • internal/recipes/bundled/xfce/install-alpine.sh

Walkthrough

Bundled Alpine installation scripts now wait up to 60 seconds for an existing APK package lock before failing.

Changes

APK package-lock handling

Layer / File(s) Summary
Add lock waiting to bundled installers
internal/recipes/bundled/devtools/install.sh, internal/recipes/bundled/docker/install.sh, internal/recipes/bundled/tailscale/install.sh, internal/recipes/bundled/xfce/install-alpine.sh
APK installation commands now use apk --wait 60. Comments document the lock-wait behavior in applicable scripts.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

I’m a rabbit beside the APK queue,
Waiting sixty seconds, as scripts now do.
Docker, Tailscale, XFCE in line,
Devtools joins when locks entwine.
No rushed failure—just a patient chew.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: configuring Alpine package installation to wait for the APK lock.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch recipes-apk-wait

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NovusEdge
NovusEdge merged commit 8268495 into main Aug 10, 2026
7 of 8 checks passed
@NovusEdge
NovusEdge deleted the recipes-apk-wait branch August 10, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant